package com.gopay.common.cps.dao.cbrmb.impl;

import java.io.Serializable;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Repository;

import com.gopay.common.base.dao.impl.BaseDAOImpl;
import com.gopay.common.cps.dao.cbrmb.CbRmbBatchPayInfoDAO;
import com.gopay.common.domain.cbrmb.batchpay.CbRmbBatchPayInfo;

/**
 * 跨境人民币  批量支付信息表DAO实现类
 * 
 * @CbRmbBatchPayInfoDAOImpl.java
 * @author lailingyu
 * @2017-8-22 下午2:42:13 www.gopay.com.cn Inc.All rights reserved.
 */
@Repository("cbRmbBatchPayInfoDAO")
public class CbRmbBatchPayInfoDAOImpl extends BaseDAOImpl<CbRmbBatchPayInfo, Serializable>
		implements CbRmbBatchPayInfoDAO {

	@Override
	public List<CbRmbBatchPayInfo> findByTransDtlSq(int transDtlSq) {
		String hql = "from CbRmbBatchPayInfo where transDtlSq =:transDtlSq";
		Map<String, Object> param = new HashMap<String, Object>();
		param.put("transDtlSq", transDtlSq);
		return findByHql(hql, param);
	}

	@Override
	public List<CbRmbBatchPayInfo> findByBatchId(String batchId) {
		String hql = "from CbRmbBatchPayInfo where batchId =:batchId order by createdTime";
		Map<String, Object> param = new HashMap<String, Object>();
		param.put("batchId", batchId);
		return findByHql(hql, param);
	}

	@Override
	public List<CbRmbBatchPayInfo> findByGopayOrderId(String gopayOrderId) {
		String hql = "from CbRmbBatchPayInfo where gopayOrderId =:gopayOrderId";
		Map<String, Object> param = new HashMap<String, Object>();
		param.put("gopayOrderId", gopayOrderId);
		return findByHql(hql, param);
	}

}
